package com.cloudkinto.service.role;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.vo.menu.RolePageVo;
import com.cloudkinto.entity.RoleDo;
import com.cloudkinto.vo.role.menu.MenuInitRes;
import com.cloudkinto.vo.role.menu.MenuNewTreeRes;
import com.cloudkinto.vo.role.role.RoleAddReq;
import com.cloudkinto.vo.role.role.RoleDetailRes;
import com.cloudkinto.vo.role.role.RoleGiveMenuReq;
import com.cloudkinto.vo.role.role.RoleUpdateReq;
import com.cloudkinto.vo.role.role.omp.RoleOmpAddReq;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-05-29
 */
public interface RoleService extends IService<RoleDo> {

    List<String> getButton(Long roleId, Integer system);

    void add(RoleAddReq req, Long userId, Long companyId, String source);

    void giveMenu(RoleGiveMenuReq req, String source);

    MenuInitRes giveMenuInit(String source);

    RoleDetailRes updateInit(Long id, String source);

    RoleUpdateReq update(RoleUpdateReq req, Long companyId, Long tenantId, String source);

    int delete(Long id, Long userId, Long companyId, Long tenantId, String source);

    PageResult getListPage(Map<String, Object> map);

    List<RolePageVo> getList(Long companyId, Long tenantId, String source);

    List<MenuNewTreeRes> getMenuTree(Long roleId, Integer system, Long companyId);

    Long ompAdminRoleAddForCompany(Long companyId, Long userId, Long tenantId);

    Long ompRoleAddForTenant(RoleOmpAddReq req, Long tenantId, Long userId);

}
